Don't decrement the init_ref_count towards -infinity
authorMatthias Clasen <mclasen@redhat.com>
Wed, 27 Mar 2013 01:27:21 +0000 (21:27 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 27 Mar 2013 01:27:21 +0000 (21:27 -0400)
Once we are at zero, initialization is done.

gdk/wayland/gdkscreen-wayland.c

index 5d1768882a274e167fa9540edf64424e7d75b2e7..1acc81aa3de86d2a43030b5162fe66c624ab4dfb 100644 (file)
@@ -872,8 +872,10 @@ output_handle_geometry(void *data,
   monitor->output_name = g_strdup (model);
 
   /* Once we have the geometry event we know we have all events
-   * from the wl_output and need no further init roundtrips. */
-  display->init_ref_count--;
+   * from the wl_output and need no further init roundtrips.
+   */
+  if (display->init_ref_count > 0)
+    display->init_ref_count--;
 }
 
 static void